package com.msb.property.model;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author sunpeng
 * @Date 2021-07-14 8:49
 */
@Component
@PropertySource(value = "classpath:bookConfig.yaml")
@ConfigurationProperties(prefix = "springboot-base.book")
public class Book {
    //@Value("${springboot-base.book.name}")
    private String name;
    //@Value("${springboot-base.book.price}")
    private Double price;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}
